package com.parenting.controller;


import com.parenting.entities.SystemRoleDO;
import com.parenting.oauth2.config.AuthUtil;
import com.parenting.service.SystemRoleService;
import com.parenting.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author 烟台业达-王世玺
 * @since 2021-09-13
 */
@RestController
@Api(tags = "职位", description = "提供角色的增删改查")
@RequestMapping("/role")
public class SystemRoleController {
    @Autowired
    private SystemRoleService systemRoleService;
    /***
     * 角色下拉
     */
    @ApiOperation("职位下拉")
    @GetMapping
   public   Result<List<SystemRoleDO>> getListRole(){
        List<SystemRoleDO> listRole = systemRoleService.getListRole(AuthUtil.getUserInfo().getShopId());
        return Result.buildSuccess(listRole);
   }

}

